import {baseUrl} from "./config.js"
function http(url="",data={},token="",method="GET"){
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseUrl+url,
			data,
			method,
			header:{
				authorization: token,
				'content-type': 'application/x-www-form-urlencoded'
			},
			success:res=>{
				resolve(res)
			},
			fail:err=>{
				reject(err)
			}
		})
	})
}

export{http}